package com.fjrcloud.controller;

import com.fjrcloud.entity.*;
import com.fjrcloud.service.HousingDecorateService;
import com.fjrcloud.utils.StatusUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by shengjian.lin on 17-1-18.
 */
@Controller
@RequestMapping("api/housing/decorate")
public class HousingDecorateLevelController {

    @Autowired
    private HousingDecorateService service;

    @RequestMapping("level/save")
    @ResponseBody
    public ResponseBean saveDecorateLevel(HousingDecorateLevel decorateLevel){

        return ResponseFactory.getResponseBean(StatusUtils.Success,service.saveDecorateLevel(decorateLevel));
    }
    @RequestMapping("level/get")
    @ResponseBody
    public ResponseBean getDecorateLevel(Integer id){
        return ResponseFactory.getResponseBean(StatusUtils.Success,service.getDecorateLevel(id));
    }
    @RequestMapping("level/del")
    @ResponseBody
    public ResponseBean delDecorateLevel(Integer id){
        service.delDecorateLevel(id);
        return ResponseFactory.getResponseBean(StatusUtils.Success);
    }

    @RequestMapping("intoNew/save")
    @ResponseBody
    public ResponseBean saveDecorateIntoNew(HousingDecorateIntoNew intoNew){

        return ResponseFactory.getResponseBean(StatusUtils.Success,service.saveDecorateIntoNew(intoNew));
    }
    @RequestMapping("intoNew/get")
    @ResponseBody
    public ResponseBean getDecorateIntoNew(Integer id){
        return ResponseFactory.getResponseBean(StatusUtils.Success,service.getDecorateIntoNew(id));
    }
    @RequestMapping("intoNew/del")
    @ResponseBody
    public ResponseBean delDecorateIntoNew(Integer id){
        service.delDecorateIntoNew(id);
        return ResponseFactory.getResponseBean(StatusUtils.Success);
    }
}
